package com.wly.ui
{
	import com.wly.adapter.MapEditerMainAdapter;
	import com.wly.ui.common.IItemGrid;
	import com.wly.ui.common.SpriteObject;
	
	import flash.display.BitmapData;
	import flash.display.DisplayObject;
	import flash.text.TextField;
	
	public class Status extends SpriteObject implements IItemGrid
	{
		private var _mcItem:ItemCell;
		private var _tfText:TextField;
		static private var _status:Status;
		
		public function Status()
		{
			super();
			
			_mcItem = getChildByName("mcItem") as ItemCell;
			_mcItem.disableMouseOver();
			_mcItem.parentUI = this;
			_tfText = getChildByName("tfText") as TextField;
			_tfText.text = "地图编辑";
			_status = this;
		}
		
		static public function getInstance():Status
		{
			return _status;
		}
		
		public function updateItem(bmd:BitmapData):void
		{
			_mcItem.updateBmd(MapEditerMainAdapter.CURBMD);
		}
		
		public function set text(str:String):void
		{
			if(!str)
			{
				_tfText.text = "";
			}
			else
			{
				_tfText.text = str;
			}
		}
		
		public function onSelect(index:int):void
		{
			MapEditerMainAdapter.CURBMD = null;
		}
		
		public function setTop(displayObject:DisplayObject):void
		{
		}
		
		public function onItemMouseOver(index:int):void
		{
		}
	}
}